app.controller("loginCtrl", function($scope, loginService, $log) {
    $log.info('LoginController initialize');

    $scope.username = "";
    $scope.password = "";

    /**
     * 回车事件
     * @param e
     */
    $scope.enterEvent = function (e) {
        var keycode = window.event ? e.keyCode : e.which;
        if (keycode == 13) {
            $scope.login();
        }
    };

    /**
     * 登录
     */
    $scope.login = function () {
        if (isNullOrEmpty($scope.username)) {
            message_alert('提示', '请输入用户名！',null);
            return;
        }
        if (isNullOrEmpty($scope.password)) {
            message_alert('提示', '请输入密码！',null);
            return;
        }
        $("#form").submit();
    };

});